home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / sound / adpcm.h < prev    next >
C/C++ Source or Header  |  2000-04-04  |  2KB  |  66 lines

  1. #ifndef ADPCM_H
  2. #define ADPCM_H
  3.  
  4. #define MAX_ADPCM 8
  5.  
  6. /* NOTE: Actual sample data is specified in the sound_prom parameter of the game driver, but
  7.    since the MAME code expects this to be an array of char *'s, we do a small kludge here */
  8.  
  9. struct ADPCMsample
  10. {
  11.     int num;       /* trigger number (-1 to mark the end) */
  12.     int offset;    /* offset in that region */
  13.     int length;    /* length of the sample */
  14. };
  15.  
  16.  
  17. /* a generic ADPCM interface, for unknown chips */
  18.  
  19. struct ADPCMinterface
  20. {
  21.     int num;                   /* total number of ADPCM decoders in the machine */
  22.     int frequency;             /* playback frequency */
  23.     int region;                /* memory region where the samples come from */
  24.     void (*init)(const struct ADPCMinterface *, struct ADPCMsample *, int max); /* initialization function */
  25.     int mixing_level[MAX_ADPCM];     /* master volume */
  26. };
  27.  
  28. int ADPCM_sh_start(const struct MachineSound *msound);
  29. void ADPCM_sh_stop(void);
  30. void ADPCM_sh_update(void);
  31.  
  32. void ADPCM_trigger(int num, int which);
  33. void ADPCM_play(int num, int offset, int length);
  34. void ADPCM_setvol(int num, int vol);
  35. void ADPCM_stop(int num);
  36. int ADPCM_playing(int num);
  37.  
  38.  
  39. /* an interface for the OKIM6295 and similar chips */
  40.  
  41. #define MAX_OKIM6295             2
  42. #define MAX_OKIM6295_VOICES        4
  43. #define ALL_VOICES                -1
  44.  
  45. struct OKIM6295interface
  46. {
  47.     int num;                          /* total number of chips */
  48.     int frequency[MAX_OKIM6295];    /* playback frequency */
  49.     int region[MAX_OKIM6295];        /* memory region where the sample ROM lives */
  50.     int mixing_level[MAX_OKIM6295];    /* master volume */
  51. };
  52.  
  53. int OKIM6295_sh_start(const struct MachineSound *msound);
  54. void OKIM6295_sh_stop(void);
  55. void OKIM6295_sh_update(void);
  56. void OKIM6295_set_bank_base(int which, int voice, int base);    /* set voice to ALL_VOICES to set all banks at once */
  57. void OKIM6295_set_frequency(int which, int voice, int frequency);    /* set voice to ALL_VOICES to set all banks at once */
  58.  
  59. READ_HANDLER( OKIM6295_status_0_r );
  60. READ_HANDLER( OKIM6295_status_1_r );
  61. WRITE_HANDLER( OKIM6295_data_0_w );
  62. WRITE_HANDLER( OKIM6295_data_1_w );
  63.  
  64.  
  65. #endif
  66.